<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
	<f:view>
		<h:body>
			<ui:composition template="/template/template.xhtml">
				<ui:define name="conteudo">
					<h:form>
					<rich:messages />
					<rich:panel>
					
							<rich:dataTable value="#{postoBean.postos}"  var="item" id="tabela">
								<rich:column>
									<f:facet name="header">
										<h:outputText value="#{res.nome_posto}" />
									</f:facet>
									<h:commandLink value="#{item.noPosto}" action="#{postoBean.edit}">
											<f:setPropertyActionListener target="#{postoBean.posto.idPosto}" value="#{item.idPosto}" /> 
									</h:commandLink>
								</rich:column>
								<rich:column style="text-align:center;">
									<f:facet name="header">
										<h:outputText value="#{res.remover}" />
									</f:facet>
									<a4j:commandLink value="X" action="#{postoBean.remove()}" render="tabela">
										<f:setPropertyActionListener target="#{postoBean.posto.idPosto}" value="#{item.idPosto}" />
									</a4j:commandLink>
								</rich:column>
						</rich:dataTable>
					</rich:panel>
				</h:form>
				</ui:define>
			</ui:composition>
		</h:body>
	</f:view>
</ui:composition>